"""
求解常微分方程的通解
"""

import sympy as sp


diff_eq = lambda x, f: sp.Pow(x, 2) + f(x) + (x - 2 * f(x)) * sp.diff(f(x), x, 1)


x = sp.symbols('x')
f = sp.Function('f')
sp.pprint(sp.dsolve(diff_eq(x, f), f(x)))
